package com.project.xsf.service.impl;

import com.project.junM.entity.TMember;
import com.project.xsf.entity.TInterposeClassify;
import com.project.xsf.entity.TInterposeScheme;
import com.project.xsf.mapper.TInterposeClassifyMapper;
import com.project.xsf.mapper.TInterposeSchemeMapper;
import com.project.xsf.service.TInterposeClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpSession;
import java.util.List;

@Transactional
@Service
public class TInterposeClassifyImpl implements TInterposeClassifyService {
    @Autowired
    private TInterposeClassifyMapper tInterposeClassifyMapper;
    @Autowired
    private TInterposeSchemeMapper tInterposeSchemeMapper;


    @Override
    public List<TInterposeClassify> queryById(HttpSession session) {
        TMember member = (TMember) session.getAttribute("user");

        return tInterposeClassifyMapper.queryById(member.getId());
    }

    @Override
    public List<TInterposeScheme> selectByMemberId(HttpSession session) {
        TMember member = (TMember) session.getAttribute("user");
        return tInterposeSchemeMapper.selectByMemberId(member.getId());
    }
}
